import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/index',
      name: '哈哈',
      component: HelloWorld,
      redirect: '/index/index',
      children: [{
        path: 'index',
        name: '首页',
        component: () =>
            import('@/components/index/index')
      }]
    },
    {
      path: '/foodType',
      name: 'foodType',
      component: HelloWorld,
      redirect: '/foodType/index',
      children: [{
        path: 'index',
        name: '商品类型',
        component: () =>
          import('@/components/foodType/index')
      }]
    }
  ]
})
